//
//  LXDevSettingModel.m
//  bgms_d
//
//  Created by Mountain on 17/3/2019.
//  Copyright © 2019 lachesis-zhu. All rights reserved.
//

#import "LXDevSettingModel.h"

@implementation LXDevSettingModel

+ (LXDevSettingModel *)shareSettingModel
{
    static LXDevSettingModel *dataModel;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        dataModel = [[LXDevSettingModel alloc] init];
    });
    return dataModel;
}

- (NSString *)tempCTempF:(NSString *)cTemp {
    NSInteger temp = [cTemp integerValue];
    if (self.tempUnitF) {
        return [NSString stringWithFormat:@"%.0f°F", temp * 1.8 + 32];
    }
    return [NSString stringWithFormat:@"%@°C", cTemp ? cTemp : @"~"];;
}

- (NSString *)tempFTempC:(NSString *)fTemp {
    NSInteger temp = [fTemp integerValue];
    if (self.tempUnitF) {
        return [NSString stringWithFormat:@"%.0f", (temp - 32) / 1.8];
    }
    return [NSString stringWithFormat:@"%@", fTemp ? fTemp : @"~"];
}
@end
